package observer.source;

/**
 * @author Chen Guang
 * @date 2019/4/9 0009 下午 16:08
 */
public class Test {
    public static void main(String[] args) {
        Subject subject = new ConcreteSubject();
        subject.attach(new ConcreteObserver("李建刚", subject));
        subject.attach(new ConcreteObserver("赵铁柱", subject));
        subject.attach(new ConcreteObserver("张全蛋", subject));
        //改变通知者状态
        subject.setSubjectState("出事啦，夭寿啦，要下大雨啦！！！");
        subject.notifyObserver();
    }
}
